<template>
  <el-row class="menu_page">
    <el-col>
      <el-menu class="el-menu-vertical-demo"
               background-color="#324057"
               text-color="#fff"
               active-text-color="#409eff">
        <router-link to="/IndexHome">
          <el-menu-item index="0">
            <i class="el-icon-house"></i>
            <span slot="title">首页</span>
          </el-menu-item>
        </router-link>

        <template v-for="item in items">
          <el-submenu v-if="item.children" :index="item.path" :key="item.path">
            <template slot="title">
              <i style="margin-left: -70px;" :class="'fa fa-margin '+item.icon"></i>
              <span slot="title">{{item.name}}</span>
            </template>
            <router-link v-for="(citem,cindex) in item.children" :to="citem.path" :key="cindex">
              <el-menu-item :index="citem.path">
                <i style="margin-left: 10px;" :class="citem.icon"></i>
                <span slot="title">{{citem.name}}</span>
              </el-menu-item>
            </router-link>

          </el-submenu>
        </template>
      </el-menu>
    </el-col>
  </el-row>
</template>

<script>
export default {
  name: "left-menu",
  data() {
    return {
      items: [
        {
          icon: "el-icon-s-custom",
          name: "用户管理",
          path: "fund",
          children: [
            {
              icon: "el-icon-view",
              path: "userExcel",
              name: "用户信息"
            },
            // {
            //   icon: "el-icon-view",
            //   path: "123",
            //   name: "实验数据"
            // },
            {
              icon: "el-icon-view",
              path: "UserInfo",
              name: "收益明细"
            }
          ]
        },
        {
          icon: "el-icon-s-marketing",
          name: "基金管理",
          path: "info",
          children: [
            // {
            //   icon: "el-icon-view",
            //   path: "infoshow",
            //   name: "基金信息"
            // },
            {
              icon: "el-icon-view",
              path: "UserInput",
              name: "用户投入"
            }
          ]
        },
        {
          icon: "el-icon-s-flag",
          name: "阶段管理",
          path: "5",
          children: [
            {
              icon: "el-icon-view",
              path: "StageInfo",
              name: "阶段信息"
            }
          ]
        },
        {
          icon: "el-icon-s-tools",
          name: "后台管理",
          path: "info1",
          children: [
            // {
            //   icon: "el-icon-view",
            //   path: "dataSetting",
            //   name: "新增场次"
            // },
            {
              icon: "el-icon-view",
              path: "/sites",
              name: "场次管理"
            },
          ]
        }
      ]
    }
  }
};
</script>

<style scoped>
.menu_page {
  position: fixed;
  /* width: 180px; */
  /*top: 71px;*/
  left: 0;
  min-height: 100%;
  background-color: #324057;
  z-index: 99;
  text-align: center;
}

.el-menu {
  border: none;
}

.fa-margin {
  margin-right: 5px;
}

.el-menu-vertical-demo:not(.el-menu--collapse) {
  width: 180px;
  min-height: 400px;
}

.el-menu-vertical-demo {
  width: 35px;
}

.el-submenu .el-menu-item {
  min-width: 180px;
}

.hiddenDropdown,
.hiddenDropname {
  display: none;
}

a {
  text-decoration: none;
}
</style>
